package com.zhangsr.zus.rpc.api.proxy;

import com.zhangsr.zus.rpc.api.Invoker;
import com.zhangsr.zus.rpc.api.RpcProxyFactory;
import com.zhangsr.zus.rpc.api.exception.RpcException;

/**
 * @Author: zhangsr
 */
public abstract class AbstractProxyFactory implements RpcProxyFactory {

    public <T> T getProxy(Invoker<T> invoker) throws RpcException {
        Class<?>[] interfaces = new Class<?>[1];
        interfaces[0] = invoker.getInterface();

        return getProxy(invoker, interfaces);
    }

    public abstract <T> T getProxy(Invoker<T> invoker, Class<?>[] types);

}
